home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-14 / chk4hypd.zip / CHK4HYPD.ASM < prev    next >
Assembly Source File  |  1991-12-29  |  2KB  |  73 lines

  1. ; CHK4HYPD, a quick hack that should check whether or not HyperDisk v4.20+ is
  2. ; installed.  If it is, ERRORLEVEL 1 is returned, 0 if it's not.
  3. ;
  4. ; By Michael Shields.  Released to the public domain with no warranty at all,
  5. ; expressed or implied, etc., etc.  Written 12-29-91.
  6. ;
  7. ; The code's probably not very good, but it works.  Feel free to change it.
  8. ;
  9. ; Based on this entry from Ralf Brown's interrupt list v27:
  10. ;
  11. ;    ----------2FDF--BX4448-----------------------
  12. ;    INT 2F - Multiplex - HyperDisk v4.20+ - INSTALLATION CHECK
  13. ;            AH = DFh
  14. ;            BX = 4448h ('DH')
  15. ;    Return: AL = FFh if installed
  16. ;                CX = 5948h ('YH')
  17. ;                BX:DX -> ??? in resident portion if BX=4448h on entry
  18. ;    Note:   HyperDisk is a shareware disk cache by HyperWare (Roger Cross)
  19. ;    SeeAlso: INT 13/AX=8EEDh
  20.  
  21.  
  22. true            equ -1
  23. false           equ 0
  24.  
  25.  
  26. ; CHK4HYPD can be assembled to check AL and/or CX.  To modify the checking,
  27. ; just change these equates and reassemble.  If checking both is too picky for
  28. ; your version of HyperDisk, try setting CheckCX false.  If it STILL doesn't
  29. ; work, you can try CheckAL false and CheckCX true.
  30.  
  31. CheckAL         equ true
  32. CheckCX         equ true
  33.  
  34. ; The following directives produce an error if you set *BOTH* to "false".
  35.  
  36. ife CheckAL
  37. ife CheckCX
  38.     .err You need to set at least one equate--CheckAl or CheckCX--to TRUE.
  39. endif
  40. endif
  41.  
  42.  
  43. .MODEL SMALL
  44.  
  45. .STACK 128                              ;It's a simple program!
  46.  
  47. .CODE
  48.  
  49. Main        PROC
  50.  
  51.             mov ah, 0DFh
  52.             mov bx, 4448h
  53.             int 2Fh
  54.         if CheckAL
  55.             cmp al, 0FFh
  56.             jne NotInstalled
  57.         endif
  58.         if CheckCX
  59.             cmp cx, 5948h
  60.             jne NotInstalled
  61.         endif
  62.             mov al, 1
  63.             jmp SHORT Exit
  64. NotInstalled:
  65.             xor al, al
  66. Exit:       mov ah, 4Ch
  67.             int 21h
  68.  
  69. ENDP        Main
  70.  
  71.  
  72. END
  73.